Integrand size = 13, antiderivative size = 39 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a}+\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a} \]
[Out]
Time = 0.11 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3973, 3967, 8} \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a}-\frac {\tan ^3(x) (1-\csc (x))}{3 a}+\frac {\tan (x) (3-2 \csc (x))}{3 a} \]
[In]
[Out]
Rule 8
Rule 3967
Rule 3973
Rubi steps \begin{align*} \text {integral}& = \frac {\int (-a+a \csc (x)) \tan ^4(x) \, dx}{a^2} \\ & = -\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int (3 a-2 a \csc (x)) \tan ^2(x) \, dx}{3 a^2} \\ & = \frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a}+\frac {\int -3 a \, dx}{3 a^2} \\ & = -\frac {x}{a}+\frac {(3-2 \csc (x)) \tan (x)}{3 a}-\frac {(1-\csc (x)) \tan ^3(x)}{3 a} \\ \end{align*}
Time = 0.23 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.59 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {4 \cos (2 x)-2 \sin (x)+(-5+6 x) \cos (x) (1+\sin (x))}{6 a \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right ) \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )^3} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.34 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.28
method | result | size |
risch | \(-\frac {x}{a}-\frac {2 \left (5 \,{\mathrm e}^{i x}+4 i+3 \,{\mathrm e}^{3 i x}\right )}{3 \left (i+{\mathrm e}^{i x}\right )^{3} \left ({\mathrm e}^{i x}-i\right ) a}\) | \(50\) |
default | \(\frac {-2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )+\frac {2}{3 \left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}-\frac {1}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {3}{2 \left (\tan \left (\frac {x}{2}\right )+1\right )}-\frac {1}{2 \left (\tan \left (\frac {x}{2}\right )-1\right )}}{a}\) | \(54\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.97 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {3 \, x \cos \left (x\right ) + 4 \, \cos \left (x\right )^{2} + {\left (3 \, x \cos \left (x\right ) - 1\right )} \sin \left (x\right ) - 2}{3 \, {\left (a \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )}} \]
[In]
[Out]
\[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=\frac {\int \frac {\tan ^{2}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 94 vs. \(2 (33) = 66\).
Time = 0.31 (sec) , antiderivative size = 94, normalized size of antiderivative = 2.41 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {2 \, {\left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {6 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {3 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + 2\right )}}{3 \, {\left (a + \frac {2 \, a \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {2 \, a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac {a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}\right )}} - \frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.26 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=-\frac {x}{a} - \frac {1}{2 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) - 1\right )}} - \frac {9 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 24 \, \tan \left (\frac {1}{2} \, x\right ) + 11}{6 \, a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{3}} \]
[In]
[Out]
Time = 19.84 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.31 \[ \int \frac {\tan ^2(x)}{a+a \csc (x)} \, dx=\frac {-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3-4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {4}{3}}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right )\,{\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^3}-\frac {x}{a} \]
[In]
[Out]